﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace HQPad.Models
{
    /// <summary>
    /// A skill cost record.
    /// <list type="bullet">
    ///     <listheader>Costs are either:</listheader>
    ///     <item>A plain cost with value held in cost field, e.g. 10.</item>
    ///     <item>A rank multiplied cost in which case the multiplier field holds the factor,
    ///     e.g. R*10.</item>
    ///     <item>Rank + constant multiplied by the factor.  The factor is held in the 
    ///     multiplier field and the constant in the cost field. e.g. (2+R)*3.</item>
    /// </list> 
    /// </summary>
    public class SkillCost
    {
        public int SkillCostID { get; set; }

        public int SkillID { get; set; }
        public virtual Skill Skill { get; set; }

        public int PointsTableID { get; set; }
        public virtual PointsTable Table { get; set; }

        [Display(Name = "Skill cost or constant")]
        public int? Cost { get; set; }
        
        [Display(Name = "Rank multiplication factor")]
        public int? Factor { get; set; }

        [Required(ErrorMessage = "The available flag is required")]
        [Display(Name = "Skill available")]
        public bool Available { get; set; }
    }
}